<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>🎂 给宝贝的生日敲金蛋游戏 💖</title>
        <style>
              body {
                  font-family: "Comic Sans MS", "Microsoft YaHei";
                      background: radial-gradient(circle at center, #ffe8b3, #f7c86c);
                          text-align: center;
                              margin: 0;
                                  padding: 20px;
                                    }
                                      h1 {
                                          color: #d47f00;
                                              text-shadow: 1px 1px 2px #fff, 0 0 25px gold;
                                                }
                                                  .gift-editor {
                                                      margin: 20px auto;
                                                          background: #fff8e6;
                                                              padding: 10px;
                                                                  border-radius: 12px;
                                                                      width: 300px;
                                                                          box-shadow: 0 2px 8px rgba(0,0,0,0.2);
                                                                            }
                                                                              .gift-editor textarea {
                                                                                  width: 90%;
                                                                                      height: 80px;
                                                                                          border: 1px solid #e0c469;
                                                                                              border-radius: 6px;
                                                                                                  padding: 5px;
                                                                                                      resize: none;
                                                                                                          background: #fffdf3;
                                                                                                            }
                                                                                                              button {
                                                                                                                  background: linear-gradient(to bottom, #ffd86f, #f6b63c);
                                                                                                                      border: none;
                                                                                                                          border-radius: 10px;
                                                                                                                              padding: 10px 20px;
                                                                                                                                  font-size: 16px;
                                                                                                                                      color: #5a3200;
                                                                                                                                          cursor: pointer;
                                                                                                                                              box-shadow: 0 3px 0 #c68b00;
                                                                                                                                                  margin-top: 8px;
                                                                                                                                                    }
                                                                                                                                                      button:hover {
                                                                                                                                                          transform: scale(1.05);
                                                                                                                                                            }
                                                                                                                                                              .egg-container {
                                                                                                                                                                  display: grid;
                                                                                                                                                                      grid-template-columns: repeat(3, 1fr);
                                                                                                                                                                          gap: 25px;
                                                                                                                                                                              justify-items: center;
                                                                                                                                                                                  margin-top: 30px;
                                                                                                                                                                                    }
                                                                                                                                                                                      .egg {
                                                                                                                                                                                          width: 100px;
                                                                                                                                                                                              height: 130px;
                                                                                                                                                                                                  background: radial-gradient(circle at 40% 30%, #fff9d0 10%, #ffd44d 60%, #e8a900 100%);
                                                                                                                                                                                                      border-radius: 50% 50% 45% 45% / 55% 55% 45% 45%;
                                                                                                                                                                                                          position: relative;
                                                                                                                                                                                                              box-shadow: inset -5px -10px 15px rgba(0,0,0,0.3), 0 3px 8px rgba(0,0,0,0.3);
                                                                                                                                                                                                                  transition: transform 0.3s, opacity 0.3s;
                                                                                                                                                                                                                      cursor: pointer;
                                                                                                                                                                                                                        }
                                                                                                                                                                                                                          .egg::after {
                                                                                                                                                                                                                              content: "";
                                                                                                                                                                                                                                  position: absolute;
                                                                                                                                                                                                                                      top: 15%;
                                                                                                                                                                                                                                          left: 20%;
                                                                                                                                                                                                                                              width: 60%;
                                                                                                                                                                                                                                                  height: 20%;
                                                                                                                                                                                                                                                      background: rgba(255,255,255,0.5);
                                                                                                                                                                                                                                                          border-radius: 50%;
                                                                                                                                                                                                                                                              filter: blur(3px);
                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                  .egg.broken {
                                                                                                                                                                                                                                                                      background: #e6c36b;
                                                                                                                                                                                                                                                                          transform: rotate(10deg) scale(0.9);
                                                                                                                                                                                                                                                                              opacity: 0.6;
                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                  .gift-popup {
                                                                                                                                                                                                                                                                                      position: fixed;
                                                                                                                                                                                                                                                                                          top: 50%;
                                                                                                                                                                                                                                                                                              left: 50%;
                                                                                                                                                                                                                                                                                                  transform: translate(-50%, -50%);
                                                                                                                                                                                                                                                                                                      background: #fff9e6;
                                                                                                                                                                                                                                                                                                          border: 2px solid gold;
                                                                                                                                                                                                                                                                                                              border-radius: 15px;
                                                                                                                                                                                                                                                                                                                  padding: 20px 30px;
                                                                                                                                                                                                                                                                                                                      box-shadow: 0 4px 15px rgba(0,0,0,0.3);
                                                                                                                                                                                                                                                                                                                          z-index: 100;
                                                                                                                                                                                                                                                                                                                              display: none;
                                                                                                                                                                                                                                                                                                                                  animation: pop 0.4s ease;
                                                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                                                      @keyframes pop {
                                                                                                                                                                                                                                                                                                                                          0% {transform: translate(-50%, -50%) scale(0.5);}
                                                                                                                                                                                                                                                                                                                                              100% {transform: translate(-50%, -50%) scale(1);}
                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                  .confetti {
                                                                                                                                                                                                                                                                                                                                                      position: fixed;
                                                                                                                                                                                                                                                                                                                                                          top: -10px;
                                                                                                                                                                                                                                                                                                                                                              width: 8px;
                                                                                                                                                                                                                                                                                                                                                                  height: 8px;
                                                                                                                                                                                                                                                                                                                                                                      background: gold;
                                                                                                                                                                                                                                                                                                                                                                          border-radius: 50%;
                                                                                                                                                                                                                                                                                                                                                                              animation: fall 3s linear infinite;
                                                                                                                                                                                                                                                                                                                                                                                  z-index: 50;
                                                                                                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                                                                                                      @keyframes fall {
                                                                                                                                                                                                                                                                                                                                                                                          0% {transform: translateY(0) rotate(0);}
                                                                                                                                                                                                                                                                                                                                                                                              100% {transform: translateY(100vh) rotate(720deg);}
                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                </style>
                                                                                                                                                                                                                                                                                                                                                                                                </head>
                                                                                                                                                                                                                                                                                                                                                                                                <body>
                                                                                                                                                                                                                                                                                                                                                                                                    <h1>🎉 宝贝生日快乐！快来敲金蛋抽惊喜 🎉</h1>

                                                                                                                                                                                                                                                                                                                                                                                                    <div class="gift-editor">
                                                                                                                                                                                                                                                                                                                                                                                                          <p>🎁 设置礼物（每行一个）</p>
                                                                                                                                                                                                                                                                                                                                                                                                            <textarea id="giftList">香水
                                                                                                                                                                                                                                                                                                                                                                                                                口红
                                                                                                                                                                                                                                                                                                                                                                                                                包包
                                                                                                                                                                                                                                                                                                                                                                                                                项链
                                                                                                                                                                                                                                                                                                                                                                                                                看电影券
                                                                                                                                                                                                                                                                                                                                                                                                                鲜花
                                                                                                                                                                                                                                                                                                                                                                                                                手写情书
                                                                                                                                                                                                                                                                                                                                                                                                                惊喜旅行
                                                                                                                                                                                                                                                                                                                                                                                                                我本人（超级大奖）</textarea><br>
                                                                                                                                                                                                                                                                                                                                                                                                                  <button onclick="updateGifts()">更新礼物</button>
                                                                                                                                                                                                                                                                                                                                                                                                                  </div>

                                                                                                                                                                                                                                                                                                                                                                                                                  <div class="egg-container" id="eggs"></div>

                                                                                                                                                                                                                                                                                                                                                                                                                  <div class="gift-popup" id="popup">
                                                                                                                                                                                                                                                                                                                                                                                                                        <h2>🎊 恭喜中奖！</h2>
                                                                                                                                                                                                                                                                                                                                                                                                                          <p id="giftText"></p>
                                                                                                                                                                                                                                                                                                                                                                                                                            <button onclick="closePopup()">关闭</button>
                                                                                                                                                                                                                                                                                                                                                                                                                            </div>

                                                                                                                                                                                                                                                                                                                                                                                                                            <script>
                                                                                                                                                                                                                                                                                                                                                                                                                                  let gifts = [];
                                                                                                                                                                                                                                                                                                                                                                                                                                    function updateGifts() {
                                                                                                                                                                                                                                                                                                                                                                                                                                        gifts = document.getElementById("giftList").value.split("\n").map(g=>g.trim()).filter(Boolean);
                                                                                                                                                                                                                                                                                                                                                                                                                                            renderEggs();
                                                                                                                                                                                                                                                                                                                                                                                                                                              }

                                                                                                                                                                                                                                                                                                                                                                                                                                                function renderEggs() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                    const container = document.getElementById("eggs");
                                                                                                                                                                                                                                                                                                                                                                                                                                                        container.innerHTML = "";
                                                                                                                                                                                                                                                                                                                                                                                                                                                            for (let i = 0; i < 9; i++) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                  const egg = document.createElement("div");
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        egg.className = "egg";
                                                                                                                                                                                                                                                                                                                                                                                                                                                                              egg.onclick = () => crackEgg(egg);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    container.appendChild(egg);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            function crackEgg(egg) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                if (egg.classList.contains("broken")) return;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    egg.classList.add("broken");
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        const gift = gifts.length ? gifts[Math.floor(Math.random() * gifts.length)] : "神秘礼物";
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            showGift(gift);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                launchConfetti();
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    function showGift(text) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        const popup = document.getElementById("popup");
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            document.getElementById("giftText").innerText = text;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                popup.style.display = "block";
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    function closePopup() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        document.getElementById("popup").style.display = "none";
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            function launchConfetti() {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                for (let i = 0; i < 30; i++) {
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      const c = document.createElement("div");
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            c.className = "confetti";
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  c.style.left = Math.random() * 100 + "vw";
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        c.style.background = `hsl(${Math.random() * 360}, 80%, 60%)`;
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              c.style.animationDuration = 2 + Math.random() * 3 + "s";
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    document.body.appendChild(c);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          setTimeout(()=>c.remove(), 4000);
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  updateGifts();
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  </script>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  </body>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  </html>